



public class Block extends Statement {

	Statements statements;

	public Block(Statements statements) {
		super();
		this.statements = statements;
	}

	public void check() throws SemanticException {
		SymbolTable table = SymbolTable.getInstance();
		table.openScope();
		statements.check();
		table.closeScope();
	}

	public boolean hasReturnStatement() {
		if (statements == null)
			return false;
		return statements.haveReturnStatement();
	}

	public String toString() {
		String ret = "Block\n";
		String s = "";
		if (statements != null) {
			s += statements.toString();
			ret += s;
			// for (String st : s.split("\n"))
			// ret += "| " + st + "\n";
		}
		return ret;
	}
}
